<template>
  <div class="mains">
    <div class="echarts-main">
      <div class="titles">节水灌溉统计</div>
      <div class="echarts">
        <echart :options="option1"/>
      </div>
    </div>
    <div class="echarts-main">
      <div class="titles">农产品投入品统计</div>
      <div class="echarts">
        <echart :options="option2"/>
      </div>
    </div>
    <div class="three">
      <div class="titles">设备动态监测</div>
      <div class="table-main">
        <div class="thead">
          <div class="trs">
            <div>名称</div>
            <div>状态</div>
          </div>
        </div>
        <div class="tbody">
          <div class="trs" v-for="item in datas">
            <div class="imgs"><img :src="item.img" alt="">{{item.name}}</div>
            <div>
              <span class="xian xian1" v-if="item.location == '正常'"></span>
              <span class="xian xian2" v-else></span>
              {{item.location}}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import Echart from '@/components/echart/Echart.vue';
import {echarts4,echarts5} from '../echarts/echart'
export default {
  components: { Echart },
  data() {
    return {
      option1:undefined,
      option2:undefined,
       datas: [{
        name: '土壤监测站',
        location: '正常',
        img: require('@/assets/images/tabimg1.png')
      },{
        name: '气象监测站',
        location: '正常',
        img: require('@/assets/images/tabimg2.png')
      },{
        name: '病虫害监测站',
        location: '正常',
        img: require('@/assets/images/tabimg3.png')
      },{
        name: '小型水源站',
        location: '异常',
        img: require('@/assets/images/tabimg4.png')
      },{
        name: '卫星苗情监测站',
        location: '异常',
        img: require('@/assets/images/tabimg5.png')
      }],
    };
  },
  created() {
    this.setEcharts();
  },
  mounted() {
    
  },

  methods: {
    setEcharts() {
      this.option1 = echarts4();
      this.option2 = echarts5();
    }
  },
};
</script>

<style lang="scss" scoped>
.mains {
  margin-top: 117px;
  height: calc(100% - 117px - 30px);
  margin-left: 20px;
  .echarts-main {
    height: calc((100% - 300px) / 2);
    .titles {
      width: 100%;
      height: 36px;
      line-height: 36px;
      font-size: 24px;
      font-family: ysbt;
      background: url(~assets/images/title_bg.png) no-repeat;
      background-size: 100% 100%;
      padding-left: 15px;
      text-shadow: 0 0 10px #fff,0 0 20px #1862b4,0 0 30px #1862b4;
    }
    .echarts {
      margin-top: 10px;
      height: calc(100% - 36px - 10px);
    }
  }
  .three {
    height: 300px;
    .titles {
      width: 100%;
      height: 36px;
      line-height: 36px;
      font-size: 24px;
      font-family: ysbt;
      background: url(~assets/images/title_bg.png) no-repeat;
      background-size: 100% 100%;
      padding-left: 15px;
      text-shadow: 0 0 10px #fff,0 0 20px #1862b4,0 0 30px #1862b4;
    }
    .table-main {
      font-size: 14px;
      width: 100%;
      margin-top: 10px;
      height: calc(100% - 36px);
      .thead {
        line-height: 36px;
        background-color: rgba(40, 151, 255, .3);
        .trs {
          div {
            color: #37DDFF !important;
          }
        }
      }
      .tbody {
        line-height: 40px;
        margin-top: 20px;
        height: calc(100% - 36px - 30px);
        overflow: auto;
        .trs {
          &:nth-child(2n+1) {
            background-color: rgba(0, 46, 75, .4);
          }
        }
      }
      .trs {
        display: flex;
        .imgs {
          display: flex;
          align-items: center;
          padding-left: 30px;
          img {
            margin-right: 5px;
            width: 20px;
          }
        }
        div {
          text-align: center;
          &:nth-child(1) {
            width: 50%;
            color: #C1E0E6;
          }
          &:nth-child(2) {
            width: 50%;
            color: #C1E0E6;
          }
          .xian {
            height: 3px;
            width: 10px;
            display: inline-block;
            vertical-align: middle;
            margin-right: 5px;
          }
          .xian1 {
            background-color: #48A79E;
          }
          .xian2 {
            background-color: #A77048;
          }
        }
      }
    }
  }
}
</style>